/* ========================================================================= */
/* ------------------------------------------------------------------------- */
/*!
  \file			mw_sheetslots.h
  \date			Sep 2011
  \author		TNick

  \brief		Contains the definition for slots refering to the sheet in MainWindow


  Copyright (c) 2011, Nicu Tofan
 All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are met:
	* Redistributions of source code must retain the above copyright
	  notice, this list of conditions and the following disclaimer.
	* Redistributions in binary form must reproduce the above copyright
	  notice, this list of conditions and the following disclaimer in the
	  documentation and/or other materials provided with the distribution.
	* Neither the name of the copyright holder nor the
	  names of its contributors may be used to endorse or promote products
	  derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS" AND
 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 DISCLAIMED. IN NO EVENT SHALL NICU TOFAN BE LIABLE FOR ANY
 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

*/
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
#ifndef __MAINWINDOW_SHEETSLOTS_INC__
#define __MAINWINDOW_SHEETSLOTS_INC__
//
//
//
//
/*  INCLUDES    ------------------------------------------------------------ */

class		QLabel;

namespace Ui {
class MainWindow;
}

#include	<main.h>

#include	<QObject>
#include	<QPointF>


/*  INCLUDES    ============================================================ */
//
//
//
//
/*  CLASS    --------------------------------------------------------------- */

/// manages signals that are intended to reach the active sheet in current MDI document.
/**
*	The slots inside manage
*	either the status of one or more ETSheetView instances (split, remove
*	split, zoom, rotate) or of the sheet that is associated with that MDI
*	document. The functionality of this class shall not overlap
*	with already defined logical units (like \ref basic_slots "Basic slots")
*
*	The current ETSheetView may be splitted horizontally or vertically.
*	Also, current split may be toogled between horizontal and vertical, or
*	it may be deleted altogether. Functionality to remove all splits, leaving
*	a single ETSheetView in MDI document is also provided.
*
*	The relation between current ETSheetView and associated ETSheet may
*	be altered by either zoomin (in or out) or by rotating (clock-wise or
*	counterclock-wise).
*/
class	MW_SheetSlots : public QObject		{
	Q_OBJECT

	friend class MainWindow;

	//
	//
	//
	//
	/*  FUNCTIONS    ------------------------------------------------------- */


	QLabel * xy_pos;


public:

	MW_SheetSlots		() ;
	~MW_SheetSlots	() ;


protected:

	/// connects the actions with designed slots
	void	initSheetSlots			(Ui::MainWindow * lc_ui);

private slots:


	/// Splits current viewport in two horizontal viewports
	void    slot_VP_SplitH          ( void );

	/// Splits current viewport in two vertical viewports
	void    slot_VP_SplitV          ( void );

	/// Toogles the orientation of current split between horizontal and vertical
	void    slot_VP_SplitTgl        ( void );

	/// Splitted viewports are rejoined
	void    slot_VP_Del             ( void );

	/// Remove all splits; Only a viewport remains
	void    slot_VP_DelAll			( void );



	/// zoom in
	void    slot_VP_ZoomIn			( void );

	/// zoom out
	void    slot_VP_ZoomOut			( void );

	/// zoom extensions
	void    slot_VP_ZoomExt			( void );

	/// zoom by window
	void    slot_VP_ZoomWin			( void );

	/// rotate the view clockwise
	void    slot_VP_RotClk			( void );

	/// rotate the view counter-clockwise
	void    slot_VP_RotCtrClk		( void );



	/// add a function (ETI_CplxTxt with one simple sub-item)
	void	slot_BasicCplx			( void );

	/// add an equation (ETI_CplxTxt with 3 simple sub-items, middle one being "=")
	void	slot_Cplx1Eq1			( void );

	/// add a formatted text box
	void	slot_MText				( void );




	/// Allows changing the background color for selection
	void    slot_VP_FormatBkCol			( void );

	/// Allows changing the color used to draw the text
	void    slot_VP_FormatForeCol		( void );

	/// Allows changing the characteristics of the font
	void    slot_VP_FormatFont			( void );

	/// Increases the size of the font
	void    slot_VP_FormatFontInc		( void );

	/// Decreases the size of the font
	void    slot_VP_FormatFontDec		( void );

	/// Removes specific formatting informations
	/**
	*	... informations about background color, text color and font;
	*	the item is left to inherit it's parent properties
	*/
	void    slot_VP_FormatClear			( void );



public:

	/// display current XY position in status bar
	void		showXY				(qreal X, qreal Y);
	/// display current XY position in status bar
	void		showXY				(QPointF pt);


	/*  FUNCTIONS    ======================================================= */
	//
	//
	//
	//

};	/* class	MW_SheetSlots */
/*  CLASS    =============================================================== */
//
//
//
//
#endif // __MAINWINDOW_SHEETSLOTS_INC__
/* ------------------------------------------------------------------------- */
/* ========================================================================= */
